home *** CD-ROM | disk | FTP | other *** search
- Path: news.inc.net!news
- From: Will Flor <willf@rrgroup.com>
- Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.basic.visual.misc
- Subject: Re: DLL, VB and Borland C/C++
- Date: 27 Mar 1996 18:28:54 GMT
- Organization: R R Systems Group Inc.
- Message-ID: <4jc1d6$2tv@news.inc.net>
- References: <312A0334.AC5@supaero.fr> <4gfg6m$eet@hasle.sn.no> <4hagmf$qc0@donald.interpac.be> <4j5mqr$su7@ohnasn01.sinet.slb.com>
- NNTP-Posting-Host: 204.95.173.139
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 32bit)
-
- primaves@manchester.gm.slb.com (Nick Primavesi) wrote:
- >tlgnsmd@mail.interpac.be (Michel Lombart) wrote:
- >
- >>Sylvain Souche <souche@supaero.fr> wrote
- >
- >>>Hi,
- >
- >>>I am trying desperatly to call a DLL created with Borland C/C++ 4.5 in a
- >>>VB 3.0 application, but VB always complains about a so called "Bad
- >>>Calling Convention Error". This Error message is not very documented,
- >>>and Borland Help files are worth nothing, so...
- >
- >> Hi Sylvain.
- >
- >>Did you use, if necessary, the "byval" option in your declaration
- >>code?
- >
- >>Michel
- >
- >I have the same problem with VB4.0 and Visual C++ DLLs
- >
- >The ByVal option is required but this does not always cure the
- >problem.
- >
-
- This may correct a parameter type error, since if you don't do this, VB
- will pass a the parameter's address to the function rather than the
- parameter itself. This can cause bizarre, unpredictable results.
-
- >
- >VB uses the PASCAL calling convention so the DLL should be compiled
- >using FAR PASCAL for 16 bit or __stdcall. This still did not cure my
- >problem but it got me closer.
- >
- >I have just been infomed that my problem is due to the omission of the
- >.DEF file by the VC++ compiler now so check that you also have the
- >DEF file with the .DLL.
- >
- >Let me know if this helps and if you discover anything that may help
- >me.
- >
-
- The function doesn't have to be exported in the .DEF file, but it has to be exported
- somehow, or nothing outside the DLL will be able to call it. IOW, the use of a .DEF
- file isn't mandatory, but it will work that way, if you choose.
-
- -Will Flor willf@rrgroup.com
- The R R Systems Group, Inc.
-
-
-